#include <corecrt_math_defines.h>
#include <iostream>

#include "Game_01.hpp"
extern coordination end;



coordination Bomb::get_coo()
{
	return coo;
}

void Bomb::forward()
{
	coordination previous_coo = get_coo();
	coo.x = previous_coo.x + cos(GF_MATH::to_radian((float)this->angle)) * move_d;
	coo.y = previous_coo.y - sin(GF_MATH::to_radian((float)this->angle)) * move_d;
}

Bomb::Bomb()
	: angle(fortInstance.angle)
{
	coo.x = GAME::base.x + end.x;
	coo.y = GAME::base.y - end.y;
#ifdef _DEBUG
	std::cout << "A new bomb\n";
#endif
}

void Bombs::add(void)
{
	bombs.push_back(Bomb());
}

void Bombs::forward()
{
	for (Bomb& bomb : bombs)
		bomb.forward();
}

Bombs::Bombs()
{
	angle = 90;
}

